﻿/***********************************************************************
 * <copyright file="IPermission.cs" company="B/S JSC">
 * -->    Copyright (C) statement. All right reserved
 * </copyright>
 * 
 * Created:   Hoang Bich Son 
 * Email:    sonhb@newman.vn
 * Website:
 * Create Date: Sunday, March 23, 2014
 * Usage: 
 * 
 * RevisionHistory: 
 * Date         Author               Description 
 * 
 * ************************************************************************/

using System.Collections.Generic;
using BusinessSecurity;

namespace DataSecurity.StandartInterfaces
{
    /// <summary>
    /// IPermission
    /// </summary>
    public interface IPermission
    {

        /// <summary>
        /// Gets the specified identifier.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <returns></returns>
        Permission Get(int id);

        /// <summary>
        /// Gets the specified code.
        /// </summary>
        /// <param name="code">The code.</param>
        /// <returns></returns>
        Permission Get(string code);

        /// <summary>
        /// Kiểm tra quyền trong site.
        /// </summary>
        /// <param name="siteId">The site identifier.</param>
        /// <param name="perCode">The per code.</param>
        /// <param name="userId">The user identifier.</param>
        /// <returns></returns>
        Permission CheckExistInRoleInSite(int siteId, string perCode, int userId);

        /// <summary>
        /// Gets the list.
        /// </summary>
        /// <returns></returns>
        List<Permission> GetList();

        /// <summary>
        /// Gets the list by user and site.
        /// </summary>
        /// <param name="userId">The user identifier.</param>
        /// <param name="siteId">The site identifier.</param>
        /// <returns></returns>
        List<Permission> GetListByUserAndSite(int userId, int siteId);

        /// <summary>
        /// Gets the paged.
        /// </summary>
        /// <param name="currentPage">The current page.</param>
        /// <param name="totalPage">The total page.</param>
        /// <returns></returns>
        List<Permission> GetPaged(int currentPage, ref int totalPage);

        /// <summary>
        /// Inserts the specified permission.
        /// </summary>
        /// <param name="permission">The permission.</param>
        /// <returns></returns>
        object Insert(Permission permission);

        /// <summary>
        /// Updates the specified permission.
        /// </summary>
        /// <param name="permission">The permission.</param>
        /// <returns></returns>
        object Update(Permission permission);

        /// <summary>
        /// Deletes the specified permission.
        /// </summary>
        /// <param name="idList">The identifier list.</param>
        /// <returns></returns>
        object Delete(string idList);
    }
}
